UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm1D7kCvkxzjdqHxJfa+5raXmHsY6BUrfKOtqrhwNyGs='
WHERE
key_id = 'e894d466f4e33ddf40f91dac390fef41c60189c24112ea4950adade53ab0bdd6'
AND (
token = 'm1D7kCvkxzjdqHxJfa+5raXmHsY6BUrfKOtqrhwNyGs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)