On my 2004 Mazda 3, when it was 14 years old, in 2018 I painted the headlights with some cheap rattlecan acrylic clear coat - UV resistant standard automotive stuff. I only kept the car for a year after that, so it lasted at least a year and looked great as the car left on a tow truck to the scrap yard after ~480,000 kms.
Results speak for themselves - and it still looked excellent the day I sold it to a scrap yard replaced with my Stinger.
Wet sanded with 240 grit - friends said I should use 600, but I said, nah, it'll be fine, and I didn't have any on hand.
The rattle can I used.
Sprayed super light coats
Half of coat #2 in the next pic!

4 - 5 extra light coats, with the final coat being as thick as possible without runs.





I was quite satisfied with the results.
In my experience, after the original OEM UV coating is worn off, polishing only lasts a few months at a time. The yellowing always returned quickly after multiple polishing attempts.
This final painting technique I used lasted much longer for me, but after a year I scrapped the car, so I don't know how many years it would have lasted.