UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CDN1WUQ1scYhjDELdYpOtE1h8P6ly0aXn2hKtZxKTMY='
WHERE
key_id = '48af77f6b4a0db3a9b44c189055753bbc16c992f74780f5ff0fd898714cf66e5'
AND (
token = 'CDN1WUQ1scYhjDELdYpOtE1h8P6ly0aXn2hKtZxKTMY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)