UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6cwhlNqxyk0qN3A+daidZV4xGqMwWfhYTGbTWFsG1LE='
WHERE
key_id = 'cb5a3dcb540a274704d5213d9753cf1a25e056a23eeb5b7cdc84bdc5f67e39c6'
AND (
token = '6cwhlNqxyk0qN3A+daidZV4xGqMwWfhYTGbTWFsG1LE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)