The Wirecutter (a reputable site which aggregates reviews about various stuff and makes money using affiliate links to their reccomended items) has posted opinion about helmet replacement. Their conclusion is that as long as it has no visible damage, has not been crashed and can be firmly fixed to your head, it is safe to use even if it is 10 years old.
The foam degrading is the last thing to worry about. Straps and retention system will most likely fail sooner.
Any more opinions on this?