UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CMECN4uxBBXCS9q41DwTyETAUjPk5plfSSjOIzF2Z8A='
WHERE
key_id = 'f7f326945e8fd9901eb4d832bc33b5e5bc2e00bc2eea740d6126d0b788c12d35'
AND (
token = 'CMECN4uxBBXCS9q41DwTyETAUjPk5plfSSjOIzF2Z8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)