UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fPGVVUFrc02RmjLtvnlC7kK6OctIKqD51pKNv++So5A='
WHERE
key_id = 'c88d2e1fa24c5a577d3bd6638a3cb909cb44433f1617a33704b2c55a13cd8eec'
AND (
token = 'fPGVVUFrc02RmjLtvnlC7kK6OctIKqD51pKNv++So5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)