You can select random rows from your MySQL database like this:
SELECT * FROM table ORDER BY rand();
If you need only 10, append LIMIT 10
Note, if you grab 30 at once, you will get 30 different ones.
If you get 3 random onces 10 times, you may get some rows twice in different files.