I have heard it is not so easy to chip 30d / 40d nowadays ***8211; BMW can pretty easy recognize the modification. It should be easier with a box, but again I have heard BMW can void warranty when they read the logs and recognize that engine was running on modified parameters
In fact I saw a letter from BMW Europe voiding warranty due to modification of the engine - they claimed that after the modification the warranty was valid only to the chassis, paint, etc. but nothing connected with electronic systems