UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CMmPgIWXxpgEUxKq3topFOMxnC2VCIdt8lS45k/y2NQ='
WHERE
key_id = 'a7b740c75fb7b8444689f75ca926d47fea89a8f7247430df5109b6e57a78383c'
AND (
token = 'CMmPgIWXxpgEUxKq3topFOMxnC2VCIdt8lS45k/y2NQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)