update = async function ({key, name}) {
  var release = await lock('dat-dns-update:' + name)
  try {
    var old = await db.get(knex('dat_dns').where({name, isCurrent: 1}))
    if (old && old.key !== key) {
      // unset old
      await db.run(knex('dat_dns').update({isCurrent: 0}).where({name}))
      events.emit('updated', {key: old.key, name: undefined})
    }

    let curr = await db.get(knex('dat_dns').where({name, key}))
    if (!curr) {
      // insert new
      await db.run(knex('dat_dns').insert({
        name,
        key,
        isCurrent: 1,
        lastConfirmedAt: Date.now(),
        firstConfirmedAt: Date.now()
      }))
    } else {
      // update current
      await db.run(knex('dat_dns').update({lastConfirmedAt: Date.now(), isCurrent: 1}).where({name, key}))
    }
    events.emit('updated', {key, name})
  } finally {
    release()
  }
}
@param {Object} opts
@param {string} opts.key
@param {string} opts.name
@returns {Promise<void>}