Combine UPDATE with INSERT...SELECT

Compeltely frustrated with this but I’m looking to add some deleting (a book from a list of books that someone might be selling) functionality.

I have a list a books in a table, but when the user deletes that book, I want to essentially move the book to a different table (books_backup) and add a couple fields at the same time (the datetime at which it was deleted, and also the book’s previous id (which was auto_incremented) moved to a different field in books_backup called ‘book_id’.

This works fine:


"INSERT INTO books_backup (book_id, isbn, title, author_name_first, author_name_last, edition, course_department, course_number, course_title, img_id, price, quality, category, user) SELECT id, isbn, title, author_name_first, author_name_last, edition, course_department, course_number, course_title, img_id, price, quality, category, user FROM books WHERE id='$book_to_delete'"

How can I add an UPDATE statement or whatever to add the datetime to that record, since doing an ‘UPDATE WHERE id=’$id’ AND title=’$title’ AND name=’$name’’ or similar query is very inefficient?

Help much appreciated.