mysql – Replace some rows in a table with rows from another table

I have two tables and a set of primary key values. I want to replace all the rows in the first table whose primary keys are in this set with the corresponding rows (that have the same primary key) of the second table.

(The two tables have the same structure.)

How to do this with MySQL and PHPMyAdmin?

You can assume that both tables have a row for each value of the primary keys in the set.