UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0eWS4uxep7ZRpSuWCG1ov3rEzTRCSWRNRhGoMtiSNsQ='
WHERE
key_id = 'e61362d2385df5f99c99095b588a62a92e8910d2a5c3c8a3920f3e83c274b666'
AND (
token = '0eWS4uxep7ZRpSuWCG1ov3rEzTRCSWRNRhGoMtiSNsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)