Updating MySQL innodb table based on multiple joins
I think this will do:

UPDATE 
    ( SELECT COUNT(DISTINCT o_id) AS total_oids 
      FROM  oak_relation 
    ) AS d
  CROSS JOIN
    oak_relation AS u
  JOIN
    ( SELECT o_id, COUNT(*) AS matching_o_ids 
      FROM  oak_relation
      GROUP BY o_id 
    ) AS o
      ON o.o_id = u.o_id
  JOIN
    ( SELECT k_id, COUNT(*) AS matching_k_ids 
      FROM oak_relation
      GROUP BY k_id 
    ) AS k
      ON k.k_id = u.k_id
SET
    u.xy = u.initial * d.total_oids / o.matching_o_ids / k.matching_k_ids ;




It would be good to check it out first by running the equivalent SELECT query:

SELECT
    u.o_id, u.k_id, u.initial,
    d.total_oids,
    o.matching_o_ids,
    k.matching_k_ids,
    u.initial * d.total_oids / o.matching_o_ids / k.matching_k_ids AS new_xy
FROM  
    ( SELECT COUNT(DISTINCT o_id) AS total_oids 
      FROM  oak_relation 
    ) AS d
  CROSS JOIN
    oak_relation AS u
  JOIN
    ( SELECT o_id, COUNT(*) AS matching_o_ids 
      FROM  oak_relation
      GROUP BY o_id 
    ) AS o
      ON o.o_id = u.o_id
  JOIN
    ( SELECT k_id, COUNT(*) AS matching_k_ids 
      FROM oak_relation
      GROUP BY k_id 
    ) AS k
      ON k.k_id = u.k_id ;