UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tMzwSJCqYF1XAmUyd4kihzQcBUkQ+DCZSVvZ6JqYOII=' 
WHERE 
  key_id = '82634a1b50d15794498c878a090534f07209a6b11e0da1414681919a4095605e' 
  AND (
    token = 'tMzwSJCqYF1XAmUyd4kihzQcBUkQ+DCZSVvZ6JqYOII=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019