UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q33L42ZVo1QV7Be8nnxRuGH+QotAGgErs9641JrH/Bo=' 
WHERE 
  key_id = '695e5b4f4befd8ba25c67f31d052ab1e10bf14f3369cf425bef0a2f666dc7f39' 
  AND (
    token = 'q33L42ZVo1QV7Be8nnxRuGH+QotAGgErs9641JrH/Bo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013