UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yAuUMrPP9dbrKgLnLLGT1w7NbG5BG2q8Cr+VywSmYAM='
WHERE
key_id = 'bf5dee2aad3797b25152870a9805810f865a01cf169227cf97611f6fec29cf8f'
AND (
token = 'yAuUMrPP9dbrKgLnLLGT1w7NbG5BG2q8Cr+VywSmYAM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)