Salt is a natural desecant and used to PREVENT bacterial build-up. So if it simply absorbed miosture from the air because the top wasn't properly sealed, then, yes, you should be fine to break up the salt, mix it and use it. If it got wet because something was spilled in it, and if there is potential for pollutants, then I'd toss it.
Some will tell you to throw it out no matter what, likely the same people who brush their teeth in RO
water before talking to their fish. I'm a bit more of a realists. If I had $40 of salt in a chunk due to careless bucket sealing, I'd keep using it.