MySQL - An UPDATE from a SELECT
Try the following:

UPDATE tests AS t JOIN testusers AS tu ON t.TestNumber= tu.TestNumber 
SET t.InactiveTestSlotBitwise = (t.InactiveTestSlotBitwise | (1 &lt;&lt; tu.UserSlot)) 
WHERE tu.UserId=25 AND tu.UserSlot &gt;= 0;