Upon the entry in the appropriate State court of record of an order under section 2261(c), a warrant or order setting an execution date for a State prisoner shall be stayed upon application to any court that would have jurisdiction over any proceedings filed under section 2254. The application shall recite that the State has invoked the post-conviction review procedures of this chapter and that the scheduled execution is subject to stay.
(b) A stay of execution granted pursuant to subsection (a) shall expire if—
a State prisoner fails to file a habeas corpus application under section 2254 within the time required in section 2263;
before a court of competent jurisdiction, in the presence of counsel, unless the prisoner has competently and knowingly waived such counsel, and after having been advised of the consequences, a State prisoner under capital sentence waives the right to pursue habeas corpus review under section 2254; or