In this type of scenario, you would light candles just before leaving your home. When you light them, you should stipulate that you are lighting them on condition that Shabbat only take effect later, i.e. that you are not accepting Shabbat with candle lighting.