`mining2`.`coin_values` AS `mcv`
`mining2`.`coins` AS `mc`
`mcv`.`coin_id` = `mc`.`id`
NOT `mc`.`abbr`='BTC' AND
`mining2`.`coin_values_snapshots` AS `mcvs_i`
ON DUPLICATE KEY UPDATE
I'm certain the issue is with "`mcv`.`timestamp`=(SELECT..." but I don't know of a better way to handle this since I don't know the specific timestamp (it changes each time) OR the specific number of unique coin_ids (It can change as my pool adds more to the mix - old coins aren't removed from the DB at this time).