Suspension forks with lockouts are the norm on any bicycle of quality in the current market.
Most really good quality forks or rear shocks which are equipped with a lockout are also equipped with a blow off valve which release the lockout when it hits a bump which exceeds the pressure the lockout valve can support. This is designed to save your shock in an emergency.
More basic forks, or older forks may not have this blow off feature, and may therefore sustain damage if more than very minor obstacles are hit, at speed, while the shock is locked out.
Even if you have a very good fork, it is advisable to use the lockout for its intended purpose, which is to increase efficiency when there is no need for the suspension, and that means that you should avoid riding rougher terrain with the lockout engaged.
Also, if you do force the blow off valve to trigger, you often need to service the shock before riding again.
Suspension is one of the more sensitive components to proper maintenance and tuning. If you treat you fork right, it should last just fine.
One thing many people fail to realize is that suspension warranties are conditional on you doing the required maintenance. For most shocks that means rebuilding them once a year. Check your manual if you need the maintenance schedule for your particular shock.