title: Atomic update and backup ON DUPLICATE KEY insert else - golang sql statement
body: <p>What is the best way to combine two statements (INSERT or (BACKUP and UPDATE)) and perform them atomically in golang?</p>
  
  <p>I found this similar question:
  <a href="https://codereview.stackexchange.com/questions/186909/query-select-and-insert-if-not-exists?newreg=067063956a834327883542c3171a22d4">https://codereview.stackexchange.com/questions/186909/query-select-and-insert-if-not-exists?newreg=067063956a834327883542c3171a22d4</a></p>
  
  <p>But the Solution does there does not fulfil 2 of the the following requirements:</p>
  
  <ol>
  <li>perform an backup of the value ON DUPLICATE KEY, </li>
  <li>use standard SQL</li>
  <li>not use store procedures but</li>
  <li>remain atomic. </li>
  </ol>