Mark exported rows as exported
The best solution will likely depend on your database server.  In PostgreSQL, the best way would be something like this:

 BEGIN; -- start transaction
 UPDATE myrows SET exported = true WHERE exported = false
 RETURNING *;
 -- do some work in the app to process these rows
 COMMIT; -- if successful, else ROLLBACK;


If that's not possible, then create a temp table, put the info you want to export in there, update exported based on the records in the temp table, and then commit once the transaction is complete.  Remember to clean up your temp table.