If you can't prevent the device from powering down, you have less than a minute to freeze the RAM before the contents become useless. This can be done with a can of cold spray.
No idea how long you have to power it back on afterwards, tens of minutes to a couple of hours probably.
That said, the proper "kill switch" operation would be to explicitly wipe the key from memory before powering off (if you want to power off instead of just locking).