I would suggest that you grab a small medium sized plastic trash bag - something large enough to contain the spray paint can and its expanded contents. Gently place the plastic bag over this can then slowly slide the can off the shelf. As it drops off the shelf, gather the plastic into a bundle so if it sprays out everywhere you don't make a huge mess, especially all over yourself.
Once you've got the end of the bag bundled up to contain whatever mess is happening inside, hold it shut, walk outside, and aim it in a safe direction. As noted in TeaToo's comment, the expansion of the propellant in the can will occupy a fair bit of space. As the bag starts to inflate with the can's contents, if it appears that it might be reaching the breaking point, you can loosen your grip and aim it away from anything you don't want painted.
Once the can has finished spilling its guts, tie it, wrap it up with a twist tie or zip tie, tape it, whatever method you choose to seal up the end, and toss it into the HazMat trash pile and take it to the appropriate facility when you get a chance.