Charcoal, 4649 46 39 bytes (noncompeting)
UONNO_¶_OAKAαA№αOβHWψβ«A§α§⌕AαO‽βXA№αOβ
Note: ψ
/k
is 1000.
Verbose
Oblong(InputNumber(), InputNumber(), "O_\n_O")
Assign(PeekAll(), a)
Assign(Count(a, "O"), b)
RefreshWhile (k, b) {
AssignAtIndex(a, AtIndex(FindAll(a, "O"), Random(b)), "X")
Assign(Count(a, "O"), b)
}