To expire a discount before its pre-set expiration date, you can disable discounts by clicking on Discounts. There, you’ll see all your codes.
You can toggle between your active, depleted (ie. has been used up), and disabled discount codes:
To disable a code, simply click on Disable on the right hand side corresponding to the code you want to disable: