MySQL Duplicate Key Entry Error when there is not already an entry for this key
From @ypercubeᵀᴹ's suggestion:

The table is MyISAM so this is probably a corruption issue. Try running CHECK and then REPAIR the table (taking the necessary backup before!)
Details and various options for both commands can be found in CHECK and the links from there.

I then ran Check Table raw_data Extended which resulted in:
livereps_webdb.raw_data     check   warning     1 client is using or hasn't closed the table prope...
livereps_webdb.raw_data     check   warning     Size of datafile is: 12921069568       Should be: ...
livereps_webdb.raw_data     check   error   Found 15839 keys of 15838
livereps_webdb.raw_data     check   error   Corrupt

I then ran Repair Table raw_data Extended which resulted in:
livereps_webdb.raw_data     repair  info    Found block that points outside data file at 12921...
livereps_webdb.raw_data     repair  info    Found block with too small length at 12921068496; ...
livereps_webdb.raw_data     repair  info    Found block that points outside data file at 12921...
livereps_webdb.raw_data     repair  info    Found block that points outside data file at 12921...
livereps_webdb.raw_data     repair  status  OK

This fixed the problem.