UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'trRhMt9mSoEknIFkUFYXQG0y8y6H+bjNbWumNL+zghE='
WHERE
key_id = '308b5b73294c54a13c60cfb84ff59407f08cb294f4b26e3c85eb05a5665ed753'
AND (
token = 'trRhMt9mSoEknIFkUFYXQG0y8y6H+bjNbWumNL+zghE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)