Conditional action hook

Woocommerce adds the action hook at priority order 30.

add_action('woocommerce_single_product_summary','woocommerce_template_single_add_to_cart',30);

So, You may have done

remove_action('woocommerce_single_product_summary','woocommerce_template_single_add_to_cart',30);

to remove the action from the hook. To remove an action the priority must match the priority with with the function was originally added.

Now you can do

function add_cart_button(){
  global $product;
  $id = $product->get_id();
  if($id != 1345 ):
  add_action('woocommerce_single_product_summary','woocommerce_template_single_add_to_cart',30); // You should note this should trigger later tested at 20, 30, 35 working
  endif;
}
add_action('woocommerce_single_product_summary','add_cart_button'); // This triggers at 10 by default

To add the button again.

You should check the order of execution of functions in a hook.