Store a record creation time in every record. I'd suggest the unix timestamp. Then, run a cron job that runs a script like this one:
$days = 30;
$time = time() - (60 60 24 * $DAYS);
$sql = "DELETE FROM table WHERE time < '$time'";
$result = mysql_query($sql);
If you don't have cron access, just write this script, and have it run as a "piggyback" off of some other commonly accessed page. That is, say you're accessing your database. Just run that code every time that script runs, substuting the table and time variables for the necessary ones.