How do I stop rotateAround at a given angle?

I have a simple code that starts an object rotating around a point that is 1 world unit to the left of it’s transform. Right now the rotation starts and stops when I press the space bar. I’m wondering how I can get it to rotate a certain number of degrees and then stop automatically but have no idea where to even start. For instance I’d like to press space bar, have it rotate 90 degrees around the point and waiting for the next player input. Any help?

Vector3 pivot;
bool isRotating;
public int numberOfDegrees = 90;
// Use this for initialization
void Start () 
{
	isRotating = false;
	pivot = transform.position;
}

// Update is called once per frame
void Update () 
{
	if (Input.GetKeyDown (KeyCode.Space))
		isRotating = !isRotating;
	if (isRotating == true)
		Rotate ();
}

void Rotate ()
{
	transform.RotateAround(pivot+(new Vector3(1,0,0)), Vector3.forward, numberOfDegrees * Time.deltaTime);
}

}

I would use something like this

 if (Input.GetKeyDown (KeyCode.Space))
          transform.eulerAngles = Vector3.Lerp(transform.rotation.eulerAngles, New Vector3("the angle you want to rotate to"), Time.deltaTime);

If (transform.rotation > “desired max rotation”)
{
" Disable rotate more"
}

Sorry.is it something like this?