Rotation not on the 0,0,0 axis

I just started coding opengl a few days ago. I have an object that is situated so its center is at the orgin. I want to “tilt” the object, sortof like rotating along a fixed point other than the orgin. (i.e a toll gate rising).

Do I translate the object half its length to put the orgin at the end of the object. Then rotate along x?

Translate the pivot point to the origin, rotate then translate back.

thanks