UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/umSj0oExaWRnCve996zQRFPEs6MUFEQ1ftV7R2v0ew='
WHERE
key_id = '3c1f7d475eec6eb5d8ecc5845ccac6717c2f904f52e937e5af14505d6c6c1b08'
AND (
token = '/umSj0oExaWRnCve996zQRFPEs6MUFEQ1ftV7R2v0ew='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)