How to deal with presentation time running out in a scientific conference?
First, some conferences have really strict timing and you will be given no extra time.
Second, if there is important slide or two, just do it. But make sure that you only slightly extend your time (e.g. 10%). If you are going to extend it by 50%, or 200% (I saw that, and I was pissed at both the speaker and even more - the chair for allowing that) - please, don't.
Side note: as a chair I am an ass. And while I give something like 1 min grace time (for 15 min talks), then after that:

speaker: &quot;But there is an important slide afterwards!&quot;
me: &quot;But not as important as other participants' time.&quot;

EDIT: By all means I recommend rehearsing and finishing on, or before, time. I only answer the question - whether to use extra 40 sec for 2 unfinished slides or not. &quot;You should prepare to avoid such situation&quot; is as on-topic as &quot;you should go fishing instead of attending a conference&quot;.
(If the question is &quot;Given X, should I do A or B?&quot; all legitimate answers should assume &quot;X&quot;, even if it is a suboptimal/nasty/unprofessional/embarrassing situation.)