So, if you have a pure rotation CFrame like this rotation of 45 degrees around the Y axis:
local rot = CFrame.fromOrientation(0, math.rad(45), 0)
Then doing
part.CFrame = rot * part.CFrame
will rotate your part 45 degrees around the world Y-axis, around the world origin 0,0,0.
If you want to do this same rotation, but around some pivot point other than the world origin, it’s as simple as shifting your box by that point (as an offset) rotating around the origin, then shifting back. So, if the pivot is a Vector3 position, it could look like this:
local pivot = CFrame.new( 10, 0, 40 ) -- Pivot as a CFrame, a pure position in this case
local rot = CFrame.fromOrientation(0, math.rad(45), 0) -- Pure y rotation, same as before
local rotAroundPivot = pivot * rot * pivot:Inverse()
part.CFrame = rotAroundPivot * part.CFrame
This code, as is, will rotate the part 45 degrees around the world Y axis, but with the rotation centered at the point ( 10, 0, 40 ) instead of ( 0, 0, 0 ). Because the pivot is a pure position, this multiplication is exactly the same as doing:
local pivot = Vector3.new( 10, 0, 40 )
part.CFrame = part.CFrame - pivot
part.CFrame = rot * part.CFrame
part.CFrame = part.CFrame + pivot
The CFrame multiplication version generalizes though… if the pivot is a CFrame with a non-identity orientation, the first version would rotate your part 45 degrees around the pivot CFrame’s UpVector instead of the world Y axis.
All of this assumes that you want the orientation of the box to change, not just rotate it’s position around a point. If you want to rotate just the position, you need to just do the above, plus addtionally counter rotate the part in place (around it’s own position)