Set Rotation of GameObject

Hi! I have a really quick question that I hope has a really easy fix. So I’m trying to set the rotation of the gameobject that the script is on to a specific number whenever a condition applies (in the update), but what ends up happening is that my object continues to rotate around in increments of my set number.

    if (XValue == 1)
    {
        transform.Rotatearound(Player.transform.position, Vector3.forward, 90);
    }

When XValue = 1, I want it to rotate to the rotation 90 (pivoted around the player which I already have)

Then simply set XValue back to 0, because it is calling that same line over and over