UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L+So6iZrDy7IG7gmNnjhMOfNlLHX0aLQsejpYdZLW7E='
WHERE
key_id = 'b37737ca6fbc6a66c9e00e6d58289301154deee2934ab3c0c72fe1cde3da0755'
AND (
token = 'L+So6iZrDy7IG7gmNnjhMOfNlLHX0aLQsejpYdZLW7E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)