The way I see it Mazda covers those headlights for 3 years. Get them replaced under warranty.....as a matter of fact inspect the whole car for any defects to have changed. Do these checks it at the 2 year mark.
The aftermarket had matured for Gen1 models past the 3-year warranty now. You can get D.O.T. approved Xenon kits at a fraction of the price for a new OEM. May not get all the features though but it is an alternative. They even have LED D.O.T. approved kits available right now. All that said, Mazda appears to be better than many German companies that refuse to change headlights/housings for a variety of reasons forcing you to pay out of pocket.
http://www.protuninglab.com/lighting-projector-headlights--mazda-cx-5.html