It sounds like you may be using the id column from your orders table for this value. The best way to check on it's current status and how it is working is to view the db directly and the values in this id column to see if there is an issue. This value is one that should be controlled by the db directly. If the index got reset or is staring from the last value then deleting records could have an effect on this.