UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dHhA1mG9Z9KHRvgxIq9ntlnXkEJ1m4BRFYAVIH1T6Ag='
WHERE
key_id = '68c755df5e19827f88f209293f987703446e4990dda93bb996021b880da7a16b'
AND (
token = 'dHhA1mG9Z9KHRvgxIq9ntlnXkEJ1m4BRFYAVIH1T6Ag='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)