Astronauts don’t really have air tanks, they have a rebreather system, which is much more efficient, divers just blow out bubbles with every breath, however most of that is just the same stuff you breathe in as you can’t absorb all the oxygen and nitrogen/helium isn’t processed at all, this is kind of a waste but at the cost of a very simple system.
Rebreathers basically have a system that turns carbon dioxide back into oxygen and filter the air so that they can keep breathing, this effectively lets you use all the air, and will therefore last longer
Also scuba divers are well… underwater, this means the pressure in their regular has to be the same as the pressure of the water around, and so higher pressure means more gas volume is used, and so even if astronauts had tanks, they would still last more because the pressure in space is lower
Latest Answers