I wasn't paying attention for a second and knocked the cup over.
Tips
grammar
Pattern 一不 + verb means 'at the slightest lapse in [verb]'. Common cousins: 一不小心 (one careless moment), 一不注意 (a second of not noticing). 一不留神 is slightly more literary than 一不小心.