And it's hard to tell for sure, but I think what you need for "latest of a certain class in events" is something like
SELECT * FROM events WHERE class='whatever' ORDER BY id DESC LIMIT 1
Or, if you have a timestamp on each record, I would use
SELECT * FROM events WHERE class='whatever' ORDER BY timestampfield DESC LIMIT 1
I would personally favor a timestamp field over an auto_increment id field, as it gives you much more usable information. But if you do have such a field, you would want to create an index on it or your ORDER BY will have miserable performance. From that standpoint, an auto_increment field that is the primary key will be better, even if less usable.