Start by using one object for all 3 of your Cardboxes (or use a family) and create a boolean instance variable called "available".
Cardbox is overlapping card set boolean "available" to false
else set boolean "available" to true
<>
<>
On Click(or any other trigger)
Pick Cardbox instance where Cardbox.available=1
Pick random Cardbox instance - Create object "card" at Cardbox.X, Cardbox.Y