UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '69M4RgGrplvFNYG86Q02MsZdnd76TKUgz2eJwPjdtNw='
WHERE
key_id = '8d100f0036f9214fd6c97e300ff2313f62c7c9a054cb772ff9f95911a3c77130'
AND (
token = '69M4RgGrplvFNYG86Q02MsZdnd76TKUgz2eJwPjdtNw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)