UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JeqVrWwV8fu5vFOqrxKDMbYMMPtIFsST9WbWpuczb5g='
WHERE
key_id = '7949c60351ba85bd13f6ac18737cc1f8bb50dfcc66e1b1c4a28dad35f7132b1e'
AND (
token = 'JeqVrWwV8fu5vFOqrxKDMbYMMPtIFsST9WbWpuczb5g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)