UPDATE users AS a,
       friendships AS b
SET b.notify = /*notify*/false
WHERE a.userId      = b.passiveId AND
      a.foreignKey  = /*passiveId*/'' AND
      b.activeId    = /*activeId*/0 AND
      b.removedTime = 0
