Using table lock with wp_insert_post?

Firstly, your question indicates that your plugin sometimes runs over 5 min, don’t you get script timeouts? 5 min is a very long runtime… How many posts are you adding and what’s your server environment?

Back to the problem…

May I suggest another solution?

Simply set an option that you’re doing something, and deactivate it when you’re done.

Example

function your_function() {

  $is_already_running = get_option('is_my_insert_post_running');

  if( ! $is_already_running) {
    update_option('is_my_insert_post_running', 1); // set is running trigger

    // do your post inserting here

    // When you're done, don't forget to deactivate
    update_option('is_my_insert_post_running', 0);

  } else {
    // wait for the next cron, i'm still working on the last one
  }
}

Regards, Bjorn