From what I can tell the IPN page seems ok to me, you do not need a cart display on the page though, you can just have the one in the email receipt body. Also, you do not need any redirects occurring on this page.
If you are not getting the records to update then the value may be missing for the invoice or it does not hold the session_id value like it should. This variable should be set on your page that is just before the user goes to PayPal. On this page you should have the invoice form field and it should be set to the same value you are using in your store order summary server behavior to store the id.
You can do some additional testing of your page in the state it is now in by logging into the PayPal developer center and going to Test Tools > IPN Simulator. In here you can configure the details of a test transaction including the invoice value. You can use one from an existing record in your table. This type of test should let you know if your IPN page is working properly with the values you are using. If it is then you just need to make sure that the id value you are using is being sent in the invoice element properly.