According to the theory of relativity, as an object with mass approaches the speed of light, its relative velocity relative to other objects also approaches the speed of light. However, the concept of "moving at the speed of light" is different from saying that an object is "at rest" relative to a photon.
Photons, which are particles of light, always travel at the speed of light in a vacuum, and they have no rest mass. From the perspective of a photon, time does not pass. This means that, in a sense, a photon does not experience time or distance as we do.
For an object with mass, as it approaches the speed of light, time dilation occurs, meaning time slows down for the object relative to an observer at rest. However, it is important to note that from the perspective of the object itself, it would still experience time passing normally.
So, while it is true that an object with mass can approach the speed of light and experience time dilation, it does not mean that it is moving at the same speed as a photon or that it is "at rest" relative to a photon.