CLSQL is a free database interface library for Common Lisp. It supports multiple databases, including MySQL.
MySQL's C API has a very handy feature, exposed by most MySQL access libraries, which gives you the ID of the last record inserted on your connection. It is, of course, dependent on your table having an auto-incrementing ID field.
It's not obvious from the documentation (in fact, none of CLSQL's backend-specific functionality is terribly well-documented), but you can get this data in CLSQL, too. Just do this:
(clsql-mysql::mysql-insert-id (clsql-mysql::database-mysql-ptr clsql:*default-database*))
Of course, if you're using an explicit DB connection handle, substitute that. There are a couple of other handy functions exposed which you can use the same technique to get at, too.