You could stratify your data such that the training data has all the categorical values. This can become rather tedious if you have many variables. If you only do this for one binary variable, then you simply create 2 subsets (1 set for case FALSE, 1 set for case TRUE), randomly split each into training and test sets, and then merge the training and test parts.
I don't know easy methods for stratifying for many variables but this one will achieve what you want. There, they create groups by minimizing differences in mean and variance of all variables in training and test set. This will require quite some work to implement (the authors provide some code).
If you completely randomize (i.e., not stratifying for variables) the
distribution of variables should be the same between training and
test set. This only works when you many samples - you have 30k and 'several' variables, so that shouldn't be a problem. If it is still a problem, this means that some of those categories are relatively rare. Then you should ask yourself whether those categories are at all useful for predictions: if they only seldom occur, is it worthwhile even considering them? It could of course be that these categories are very predictive of an outcome, then then they still useful and you want to use methods as I mentioned above.