Each corner should be rotated around the center of the box.
Typically this would be done by translating the box back to the origin, rotating, then translating back to the starting position.
Imagine the points that make up the corners rotating around a circle:
For rotating each point, see this answerthis answer.