UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NrmF4y/VQaxqMJnR/S+buN3yFTdWRqORkqE/ZeNgtWU='
WHERE
key_id = '6d087c204cd0f05ed6d4b681aa2b561adfba1d9e034cbf221a55f5a62bad9cd6'
AND (
token = 'NrmF4y/VQaxqMJnR/S+buN3yFTdWRqORkqE/ZeNgtWU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)