If you bring a towel, there are publicly accessible showers in both terminals.
One of the Plaza Premium locations in T1 is listed as 24 hours, but if you go there wanting to use the showers, they'll give you a towel and direct you to the publicly-accessible showers in the space next door (I believe they're contracted to clean/maintain those showers).
If you are able to enter Taiwan, there is a capsule hotel in the sterile side of T2.