UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FCcIXgKB1z8VMCOMclJYYDi6qVKbaQiMKFHYMKCUJDc='
WHERE
key_id = '8a8dbc2ccae3bc97c10517fe1d9eb7b73b9b95ea909a472affaf2a2256218a71'
AND (
token = 'FCcIXgKB1z8VMCOMclJYYDi6qVKbaQiMKFHYMKCUJDc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)