For convenience, store all your modules on the nearest detention centre - you can only get stored modules there, but it can't be put into Lockdown.
Is there a way to get the station out of Lockdown? Or you just gotta wait it out?
In 3.2, the quickest way is to push the station's controlling faction into Retreat in another system, though War, Expansion, Civil War or Election may sometimes be easier to set up. You can in theory bounty hunt your way out of them, but in most cases this takes a lot longer.
(On the other hand, Lockdowns create Threat 5-7 pirate signal sources, which are great for high-end combat and materials, so it's not all bad)
In 3.3 that won't work and bounty hunting is likely to be the best way out - but, you're likely to get more warning since it will probably have to go through Civil Unrest first. Regular bounty hunting may make Lockdowns far less likely.