Keeping your coils and filter clean will help your compressor run longer. You should also make sure of all the following:
tight electrical connections and proper voltage inputs, capacitors are good, proper air flow over evap. coil, proper charge. You may want to install a surge protector for extra protection.
Properly installed compressors (units) should last over 20 years. AC systems now a days get a bad rap because they are initially installed wrong. Good luck, hopefully you get at leat another 5 yrs.