That breaker tripped most likely because a problem on your boat. Now, if you had a large load still connect and plug-in with everything still connected, that may have caused enough of a surge to trip that breaker immediately.
First turn-off the main breaker at your boats control panel, with the breaker off, plug in the shore power cord, then turn on the breaker there at the shore power station.
If it does not trip, go and start bring the loads in on the boat.
If it trips instantly, a problem may have developed on your boats shore power plug connector or the feed wiring to or at your boats control panel.
As far as pluging the wrong way, that's impossible, they are male and female ends.
Sometimes at marinas, boats push the limits on the 30 amp rating of those breakers with demands well over the 85% they are intended, so they may have loads well over 30 amp threshold, and because of this finally become weak and nuisence trip after awhile.
But if that breaker tripped right away and took awile to reset, sounds more like a short-circuit to ground, rather than over-current.