Most fire extinguisher manufacturers recommend that the extinguisher is serviced every five years. Of course, it will depend on the type of the extinguisher. I wouldn't replace - simply get them serviced.
I know the OP is talking about his engine room, but for other fire extinguishers on the boat, typically the 1kg powder extinguishers, it is cheaper to replace than service.
Service annually, replace after 5 years.
We get the guy who services the buildings at the marina to do all the boat extinguishers at the same time. £2.50 each!!!