Crassus was part of the senatorial class but he made his wealth in commerce even though that was not allowed for senators. Was this law already abolished during his time or was he allowed to do it because of corruption?
Who says Crassus got his wealth through commerce? Plutarch's biography (online here: http://penelope.uchicago.edu/Thayer/E/Roman/Texts/Plutarch/Lives/Crassus*.html) is quite clear that the source of his fortune came from property, particularly the somewhat dishonest tactic of buying for cheap the homes and land of people proscribed by Sulla, presumably then to sell on for a profit. Plutarch also mentions the extortion of people whose homes were burning down in Rome, money-lending, silver mines, and agricultural land. Apart from the last three, his methods were not exactly reputable, but were also not necessarily illegal for a man of his social position.
Just to add on to what bigfridge commented, the law (lex Claudia) prevented Senators from owning a vessel that could carry more than 300 amphorae which essentially prevented maritime trade. However, Plutarch (Cato Maior. 21.6) informs us that Cato the Elder bypassed such law by lending money to people who formed a large company in which he bought a share and was represented by his freedman, Quintio. So, it was possible, and probably likely, that senators still engaged in commerce.
Further to that point, Cicero in his speech against Verres (70 BC) states (Verres. 2.5.45):
Do not be afraid, O Hortensius, of my asking how it became lawful for a senator to build a ship? Those are old and dead laws, as you are accustomed to call them, which forbid it.
The passage suggests that by the time of Crassus, the law was largely ignored by senators.