According to The Citizen Scientist, photons can never be at rest. They have no existence at rest, and so they have no "mass" or any other property at rest. Physicists say that a photon has no "rest mass." A photon can't be stopped and weighed. It exists entirely as a self-propagating bundle of electromagnetic fields. As the electric field collapses, it generates a magnetic field that's in a slightly different position. The electric field disappears when it transfers all its energy to the growing magnetic field. When that transfer has taken place, there is no longer anything to build the magnetic field. It then begins to collapse and to create an electric field in another slightly different position. When the cycle repeats, this bundle of electromagnetic energy has moved a bit and it turns out that the distance moved divided by the time it took for the cycle to take place is always exactly the same. This is the speed of light (c) The laws of physics determine where the magnetic field appears when the electric field collapses. You can't keep the electric and magnetic fields oscillating in place, because that violates the laws of physics. You can transfer the energy out of the field and into something else--that is, you can absorb and destroy a photon--but you can't stop it.
And yet a photon does have mass, because the mass-energy relationship still holds. For instance, if a photon has greater than about 2 MeV of energy, it can turn into two electrons (well, an electron and a positron). And one can reverse the process as well. One can bang an electron and positron together and have them disappear and be replaced by a photon that contains all the energy--mass energy, potential energy, and kinetic energy-- of the original particles. So, a photon can have potential mass, depending on the quantum state... The equation pertinent to the discussion is momentum=constant*frequency...