I am not an attorney in the state of CA so all of what I say should not be taken as legal advice and should be taken as random musings coming from a random dude on an clothing internet forum:
Month to month lease? Do you have a contract?
Read your contract carefully. In many cases, it is drafted anticipating one notice of termination only.
Typically, a contract is drafted with language that the tenant can terminate the contract at any time upon 30 days written notice. If the tenant gives notice, and such notice is given 30 days prior to the termination date given in the notice, then the lease expiration date shall be the date given in the notice, that kind of thing.
In this case, the contract could be reasonably interpreted to say once you've given notice, the lease end date is set in stone, and you can't come back and give another notice for an earlier date, and you'd have a very good basis for keeping their security deposit (or suing for the extra month if you didnt get a deposit).
You might be careful keeping their deposit though, sometimes there are state law penalties that are pretty harsh for landlords that dont return the full amount.
Finally, it might be worth it to write your tenants a letter letting them know that this is how you interpret the contract and you will hold them responsible for rent until the end of july. They may just stay until then.
Also, you might go to your new tenants and see if they want to move in early, even if just a couple weeks ago and pay a prorated rent amount. If they agree, make sure to credit the old tenant for the additional rent, when youre deducting from their deposit.
Finally, get an attorney (a cheap one).
Reliance arguments are generally very hard to make. If you have a contract, its much better to use it as a basis for your claim.