Move rows based on status to one table to another