UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0G5hHxa9anfAFLruCAcrFYfLK7y/kJUr4PZJ5nq6i+Y=' 
WHERE 
  key_id = 'e79a078e670f7b1b9424c819a9709e2e7ff4aceb2645b48b9850a54482537466' 
  AND (
    token = '0G5hHxa9anfAFLruCAcrFYfLK7y/kJUr4PZJ5nq6i+Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022