MySQL: After inserting data into a table, the table remains empty
This may run faster:
 INSERT INTO diff_set_values(value)
    select DISTINCT value 
    from diff_sets;

Either would run faster if diff_set_values had INDEX(value).  However, adding the index would take a long time.
Increase the timeout.