UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yMvLPxrddbmeR7lJCjHsKjU2WcK5I4fFHc0TAHQNjPc='
WHERE
key_id = '2e4dfdd479699e2b0ae076c25e2a3449c356ec845db7ee04b07df8b9bf3caec3'
AND (
token = 'yMvLPxrddbmeR7lJCjHsKjU2WcK5I4fFHc0TAHQNjPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)