UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7Hr1J+Z/7fW4U9k4IkuNZ9fonKP35bFk+8nVGKPq74c=' 
WHERE 
  key_id = '4700b467beade810934e79896107387c65a94fe384afdb0f3747c48c272ed792' 
  AND (
    token = '7Hr1J+Z/7fW4U9k4IkuNZ9fonKP35bFk+8nVGKPq74c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039