On the evolution of environmental and mass properties of strong lens galaxies in COSMOS