code: func (ss *SQLSubStore) UpdateSub(sub *spb.SubState) error {
  	ss.Lock()
  	defer ss.Unlock()
  	subBytes, _ := sub.Marshal()
  	r, err := ss.sqlStore.preparedStmts[sqlUpdateSub].Exec(subBytes, ss.channelID, sub.ID)
  	if err != nil {
  		return sqlStmtError(sqlUpdateSub, err)
  	}
  	// FileSubStoe supports updating a subscription for which there was no CreateSub.
  	// Not sure if this is necessary, since I think server would never do that.
  	// Stay consistent.
  	c, err := r.RowsAffected()
  	if err != nil {
  		return err
  	}
  	if c == 0 {
  		if _, err := ss.sqlStore.preparedStmts[sqlCreateSub].Exec(ss.channelID, sub.ID, subBytes); err != nil {
  			return sqlStmtError(sqlCreateSub, err)
  		}
  	}
  	return nil
  }
docs: // UpdateSub implements the SubStore interface