UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mzOQC9ww8ggLLv2zNnOP39595dCMNZf6Iwvm9THD93s='
WHERE
key_id = '71b2ff95cc2651e80416ed11ab4a06ca18e3e8cd16409185d4810b1999113bc9'
AND (
token = 'mzOQC9ww8ggLLv2zNnOP39595dCMNZf6Iwvm9THD93s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)