UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '11ATNUlKDFLLNf5lkZalBoZU2SaQ240lXBKTxk8VxEo='
WHERE
key_id = '1832bc5c636b8ca1368a7c35cecc9f3cda47755a353f0372e43d06f01c50d12b'
AND (
token = '11ATNUlKDFLLNf5lkZalBoZU2SaQ240lXBKTxk8VxEo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)