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