UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fSHTVxwSrjuCkagziFvJXtTqttt6n4x491f332JT3IQ='
WHERE
key_id = 'c6c014f46ee9d8f56c90867baaedad1d0ab1608a85ceca8175d236d4772158bb'
AND (
token = 'fSHTVxwSrjuCkagziFvJXtTqttt6n4x491f332JT3IQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)