UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SWrknknkW6AqtHtwPTC6M16G9jmMFGSnGSWRyRsEON0='
WHERE
key_id = '702c456f44d6fe177615456402fc71d188eb463e6d3b46378968b3f468eb11d8'
AND (
token = 'SWrknknkW6AqtHtwPTC6M16G9jmMFGSnGSWRyRsEON0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)