Never fear, Hollywood movie magic is here. It's probably a plastic prop, with a semi-appropriate sound effect inserted. Movies also use airsoft guns a lot.
It's very expensive to rent "live" weapons and armorers. Often there can be no exception to actual firing of real weapons. The movie or TV show will rent a friendly range, and try to get all the possible shots of stars and extras shooting the necessary weapons. There's no way yet to create special effects with real muzzle blast, real recoil, and real brass being ejected.
I was watching some extra materials from Stargate SG1. Richard Dean Anderson was talking about how much pleasure he got from the live-weapons sessions. Then, the gun-grabbing-moron his is, he added that nobody should have guns.
And that scope mount is a GG&G one-piece QD mount. It's only made in 30mm, as far as I know.