UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'htiyNlpBlBZ+G1TBJPLJHMsK7aq3pJG6CjH08RusawM='
WHERE
key_id = '19fe3d6ac13b19e3494612ea01b5af82b5e33dcd6d39a78cbbaedc0cdabd9a0e'
AND (
token = 'htiyNlpBlBZ+G1TBJPLJHMsK7aq3pJG6CjH08RusawM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)