UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'awy+52dEvIxzv1SjsO3W9bWTjPfcPWL/25n0WDdwjio='
WHERE
key_id = 'ec0b37393b136e02e75348240198131160ab6345e7849bac301ed6fb1e8f1d80'
AND (
token = 'awy+52dEvIxzv1SjsO3W9bWTjPfcPWL/25n0WDdwjio='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)