UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ViXwtu78yNxUMj3vBAhFlxJxxJXvUyWK0NLfvjMDkx4=' 
WHERE 
  key_id = 'd13b7522e7c9567f1964ff493afd0eda69fc7c97740aff0dfd34d85044caddc3' 
  AND (
    token = 'ViXwtu78yNxUMj3vBAhFlxJxxJXvUyWK0NLfvjMDkx4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014