UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a9XiedP6/DeFknwZbys4H7zagkqGmEyAPGeGHxZ8iVA=' 
WHERE 
  key_id = 'be27a8f27e4fa97a003d644c8fc733cd554401d4cb26ef69db90fbc51e14e0bc' 
  AND (
    token = 'a9XiedP6/DeFknwZbys4H7zagkqGmEyAPGeGHxZ8iVA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040