UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J5ruwIfRlTsGzY+sV7vMxYcYEorsYgEMWH9WErlFwP0='
WHERE
key_id = 'fc63560966b8f521b4afb039c6f4af4dbab8ce2c1de07f34714a43a26b7d9e0b'
AND (
token = 'J5ruwIfRlTsGzY+sV7vMxYcYEorsYgEMWH9WErlFwP0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)