UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9KMHgkU4qXA5IbUo2KDc4peIAqXnKoy0UUZjGcPhHcQ='
WHERE
key_id = '0c553b64b5df36bd8702c52cefa9deb37f263b9f5b2bba16d9c4325581bd4b08'
AND (
token = '9KMHgkU4qXA5IbUo2KDc4peIAqXnKoy0UUZjGcPhHcQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)