UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rozKqE0CVI2pc0oQCnAEy9i98MrNXsCF3QZuOP+jf7M=' 
WHERE 
  key_id = '3704023a648bb1c268b08ecb78a1b880c4f876317152cc4a9c9fe4fb07d13ca1' 
  AND (
    token = 'rozKqE0CVI2pc0oQCnAEy9i98MrNXsCF3QZuOP+jf7M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021