Rigid Body Box Flaps
You can achieve this using Rigid Body Physics and Rigid Body Constraints to form a hinge between the box and each of the flaps.

Create the box and flaps as separate objects and enable 'Active' Rigid Body Physics to each. For more realistic physics you should also set the Mass on each of the objects appropriately (in the Physics tab in the Tool panel (T) select 'Calculate Mass' and then select Cardboard).



Create Empties to act as the hinges. It's a good idea to use the 'Single Arrow' form of empty as the 'hinge' will act around the Z axis of the empty and the single arrow points along the Z axis (so the arrow will lay along the length of the hinge). Position the empties pointing along the edge between the flap and box where you require the hinge.



Parent each of the flaps and each of the empties to the box. This way, when you move the box around in the scene the hinges and flaps will follow.

Select each hinge empty in turn and in the Physics properties window enable Rigid Body Constraint. Set the Type to 'Hinge', Object 1 to the box, Object 2 to the flap, enable Z Angle limits and set the Lower and Upper limits appropriate to that flap (the angle it's allowed to bend from its initial 'at rest' position. Since the flap is already in the 'closed' position, one of the limits should be 0 degrees to prevent the flap from closing inside the box. The other limit should be a suitable angle to prevent the flap bending too far outside the box (I chose +/-250 degrees (so limits -250,0 for one and 0,250 for the other) so that it would stop at 20 degrees off the side of the box).



Running the rigid body simulation should now produce something like this :