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