The class system, while a good idea at the time, is really antiquated now. The specification for class 10 is for 10MB/s but many new "Class 10" card also state they are rated at 30MB/s, 45MB/s or even 95MB/s.
Some users have tested and reported that the k-5 maximum transfer rate is roughly 18MB/s so it would benefit from a card rated up to that speed. And would max out a standard "Class 10" 10MB/s card. I could not find any tests on the k-30 but even assuming it is no faster than the k-5 then a card rated @ 20MB/s or 30MB/s would be more than the camera would need. AFAIK Pentax has not published any specification so these numbers are based on user reports.
I've no idea about the K-10D though it may not be able to take advantage of the faster cards due to compatibility. Someone else might chip in on that.
As to your question, if you want to be able to use a card you buy today in a future camera I would buy nothing except class 10. Based on the price difference there is IMHO no point in skimping on the card to save a few dollars. My thought is that the slower class 4 or class 6 cards are likely to be made of inferior material to be sold at a price. That is just supposition on my part but if your images mean anything why take chances?
Here is a thread with some additional info:
https://www.pentaxforums.com/forums/115-pentax-k-5/170319-maximum-useful-sd-card-speed.html
I use all Sandisk Extreme Pro cards rated @ 45MB/s or 95MB/s. These are most likely far faster than the camera.