If the classes carry certain attributes, you could filter or sort a more extensive class list by attributes.
Filtering reduces the information load and helps keep relevant columns in frame without excessive lateral scrolling, which in turn limits the distances among columns across which you would otherwise drag items.
Sorting does not lower the information load but might put columns among which you may move items into closer proximity, again reducing drag distances.
A search function is always useful to access off-frame content quickly. A maximum of 30 columns, only 12 of which can be in-frame at any one time (unless filtered) is not unmanageable. 40% of editable content is always visible to users, so finding items isn't an insurmountable problem so long as you offer provisions to make the rearranging task smooth.
Besides the classic search-sort-filter triad (or even only one of those), think about introducing differentiated drag behaviour between individual cards you reassign among columns on one hand, and the ability to drag-move entire columns together with all cards assigned to them on the other. That again serves the purpose of moving the columns you're likely to make edits to into closer proximity to one another.
Lastly, consider a redundant alternate to the drag motion, such as a secondary right-click > move to... command. Drag-motion is very learnable and an apt metaphor for moving slot labels or post-its across a sorting board. A move-to action in that representation resembles taking a label out of its original slot, searching for its intended destination (which might be far away from its origin), and re-slotting it once found.