UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gsjUYdxCgZT+pSNSyhvYVSPTCZrzeuGJ4OrrpexlMrQ='
WHERE
key_id = '921ac1499138fec5ff47a0e4736302498a138eb1778d5aeee5e28b5270b1409a'
AND (
token = 'gsjUYdxCgZT+pSNSyhvYVSPTCZrzeuGJ4OrrpexlMrQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)