Can it affect the gun if it has sat in a storage unit for a year or two

All depends on the inside condition of the gun when it was stored. The seals may have dried out. They may very well be bad especially sitting that long with no sealing pressure on them. If there was any moisture inside sitting for a couple of years there will most likely be corrosion. When you pierce that first c02 you will know pretty quickly.