I think 50 years is at the longer side of ship lifetime but not especially an outlier. The big commissioning fleets sell them after a couple decades and replace them with new. The secondhand owner refits for a different purpose or partially overhaul then runs it for another couple decades. Sometimes a third owner gets some use out of it. They normally go at least 35 years before total decommissioning though, usually longer.
It depends on ship type. For example methane carriers are expected to hit 40 years of lifetime while some low-end bulk carriers are scrapped after only 15 years.