There are plenty of 30 year old 737s flying around. Number of flight hours and decompression cycles (notably: https://en.wikipedia.org/wiki/Aloha_Airlines_Flight_243) are more important, and "safe" varies from jurisdiction to jurisdiction; it's why places like Senegal have a lot of hand-me-down planes.