UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e4d3zrwJJSKplGo6cIbRebziELCEpVeIbxHIcANc9IE='
WHERE
key_id = '9739057032cd0d859730a9c2d630b190bc007acf44cc22ecd39f24e691d12c09'
AND (
token = 'e4d3zrwJJSKplGo6cIbRebziELCEpVeIbxHIcANc9IE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)